<?php
/**
 * 
 * 控制器助手 Application_Actionhelper_Flexgp 
 * 用于封装zend 官方 pagint插件,为jq的flexGrid插件提供分页服务
 * @author Jurunlong <hipop@126.com>
 *
 */
class Application_Controller_Helper_Flexgp extends Zend_Controller_Action_Helper_Abstract{
	/**
	 * 
	 * Enter description here ...
	 * @param Zend_Db_Table_Abstract $db
	 */
	
	public $page;//当前页码
	public $qtype;//查找关键词
	public $query;//查找字段
	public $rp;//每页行数
	public $sortname;//排序字段
	public $sortorder;//排序顺序
	
	public function direct(){

		//获取请求Zend_Controller_Request_Abstract
		$request = parent::getRequest();
		/*if(!$request->getParam('page'))
			return NULL;*/

		//获得参数
		$this->page = intval($request->getParam('page',1));
		$this->qtype = $request->getParam('qtype',null);
		$this->query = $request->getParam('query',null);
		$this->rp = intval($request->getParam('rp',15));
		$this->sortname = $request->getParam('sortname',null);
		$this->sortorder = $request->getParam('sortorder',null);
		
		return $this;
		
	}
}